﻿using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Windows.Input;
using System.Windows.Forms;
using System.Drawing;
using Microsoft.VisualStudio.TestTools.UITesting;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.TestTools.UITest.Extension;
using Keyboard = Microsoft.VisualStudio.TestTools.UITesting.Keyboard;
using System.Configuration;


namespace RemoteDesktopsTest
{
  /// <summary>
  /// Summary description for RemoteDesktopsCUITest
  /// </summary>
  //[CodedUITest]
  public class RemoteDesktopsCUITest
  {
    private string _exePath;
    private ApplicationUnderTest _test;

    public RemoteDesktopsCUITest()
    {
      this._exePath = String.Format("{0}\\{1}", ConfigurationManager.AppSettings["exepath"], ConfigurationManager.AppSettings["appname"]);
    }

    [TestInitialize]
    public void SetUp()
    {
      this._test = ApplicationUnderTest.Launch(this._exePath);      
    }

    /// <summary>
    /// 
    /// </summary>
    private void WaitForApplication()
    {
      
    }

    [TestCleanup]
    public void CleanUp()
    {
      this._test.Close();
    }    

    #region Additional test attributes

    // You can use the following additional attributes as you write your tests:

    ////Use TestInitialize to run code before running each test 
    //[TestInitialize()]
    //public void MyTestInitialize()
    //{        
    //    // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
    //    // For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId=179463
    //}

    ////Use TestCleanup to run code after each test has run
    //[TestCleanup()]
    //public void MyTestCleanup()
    //{        
    //    // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
    //    // For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId=179463
    //}

    #endregion

    /// <summary>
    ///Gets or sets the test context which provides
    ///information about and functionality for the current test run.
    ///</summary>
    public TestContext TestContext
    {
      get
      {
        return testContextInstance;
      }
      set
      {
        testContextInstance = value;
      }
    }
    private TestContext testContextInstance;
  }
}
